function getAttention(obj,status){
    // 查询所有关注的信号源
    myAttention_selectCountTj({}).then(function (res) {
       
        obj.attentionData = res.data.maps;
       
        if(obj.attentionData.length == 0){
            if(status == 1){
                obj.$message({
                    message: '暂时没有关注数据，请先关注!',
                    type: 'warning'
                });
            }
            obj.myAtOpacitys = false;
            obj.myAttentionOpacitys = false;
        }else{
            
            if(status == 1){
                //通过关注按钮点击进来的
                obj.myAtOpacitys = !obj.myAtOpacitys;
                obj.toolNav1 = obj.toolNav2 = obj.toolNav3 = obj.showBookmarks = false;
                obj.myAttentionOpacitys = false;
            }else if(status == 2){
                //通过 取消关注按钮 进来的
            }
        };
    }).catch(function (err) {
        console.log(err)
    });
}

function getSecAttention(obj,status){
    //根据信号源查询关注的数据
    myAttention_selectAll({
        "myAttention": {
            "createTime": "",
            "fid": "",
            "id": "",
            "signalSource": obj.AttSingle,
            "smodel": obj.searchAttAdress
        },
        "page": obj.wdgzSecondlist.curPage,
        "size": 5
 
    }).then(function (res) {
        if(res.data.myAttention.records.length > 0){
            // console.log("根据信号源查数据:"+obj);
           
            obj.attSecData = res.data.myAttention.records;
            obj.wdgzSecondlist.totalPage = Math.ceil(res.data.myAttention.totalCount/5);
            obj.wdgzSecondlist.totalNum = res.data.myAttention.totalCount;
            // obj.cursignalSource = curRow.signalSource;
        }else{
            obj.$message({
                message: '你关注的 '+obj.AttSingle+' 信号源没有数据',
                type: 'warning'
            });
            if(status == 2){
                //点击 取消关注
                obj.myAttentionOpacitys = false;
            }
            
        }
    //    console.log(res.data.myAttention.records);
    }).catch(function (err) {
        console.log(err)
    });
}


function insertSecAttention(obj,val){
    //添加关注数据
    myAttention_insdert({
        "myAttention": 	{
            "createTime": "",
            "fid": val.targetIden,
            "id": "",
            "signalSource": obj.curRowjkmbFirst.signalSource,
            "smodel": val.targetAddress
        }
    }).then(function(res){
        
        obj.getjkmbSecondlist();
        getSecAttention(obj,2);
        getAttention(obj,2);
    })
}

function delSecAttention(obj,val){
    //删除关注数据
    myAttention_delete({
        "myAttention": 	{
            "createTime": "",
            "fid": "",
            "id": val,
            "signalSource": "",
            "smodel": ""
        }
    }).then(function (res) {
        
        obj.getjkmbSecondlist();
        getSecAttention(obj,2);
        getAttention(obj,2);
    })
}